﻿using System;
using Microsoft.CodeMarkers.Contracts;

namespace Microsoft.CodeMarkers.Internal
{
    class CodeMarkerClient : ICodeMarkerClient
    {
        public event Action<int> MarkerRaised;

        void ICodeMarkerClient.OnMarkerRaised(int marker)
        {
            if (MarkerRaised != null)
            {
                Action<int> asyncAction = this.MarkerRaised;
                asyncAction.BeginInvoke(marker, (result) => asyncAction.EndInvoke(result), null);
            }
        }
    }
}
